package com.stox.client.ui.javafx.core;

import javafx.application.Platform;

public final class StoxPlatform {

	private StoxPlatform() {
		
	}

	public static void runLater(Runnable runnable){
		Platform.runLater(new ExceptionReportingRunnable(runnable));
	}
	
}


class ExceptionReportingRunnable implements Runnable{
	
	private final Runnable delegate;
	
	public ExceptionReportingRunnable(Runnable delegate) {
		this.delegate = delegate;
	}
	
	@Override
	public void run() {
		try{
			delegate.run();
		}catch(Throwable t){
			t.printStackTrace();
		}
	}
}